# $Id: PKGBUILD 278167 2016-10-10 12:21:17Z arojas $
# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=syntax-highlighting
pkgver=5.38.0
pkgrel=1
pkgdesc='Syntax highlighting engine for structured text and code'
arch=(i686 x86_64)
url='https://community.kde.org/Frameworks'
license=(GPL2)
depends=(qt5-base)
makedepends=(extra-cmake-modules qt5-xmlpatterns qt5-tools doxygen)
groups=(kf5)
source=("https://download.kde.org/stable/frameworks/${pkgver%.*}/${pkgname}-${pkgver}.tar.xz"{,.sig}
        pkgbuild-syntax-highlight.patch)
sha256sums=('d4b887e2b4c0bb0d0c723325b11897d1ab38a644e3276d57eae8393928783680'
            'SKIP'
            '4321ee61f2465966f87dde89cf60e39b30de14e82b492d9a11a5c7e725b1ad8f')
validpgpkeys=(53E6B47B45CEA3E0D5B7457758D0EE648A48B3BB) # David Faure <faure@kde.org>

prepare() {
  mkdir -p build

# Add PKGBUILD syntax highlighting
  cd $pkgname-$pkgver
  patch -p1 -i ../pkgbuild-syntax-highlight.patch
}

build() {
  cd build
  cmake ../$pkgname-$pkgver \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_BUILD_TYPE=Release \
    -DCMAKE_INSTALL_LIBDIR=lib \
    -DBUILD_TESTING=OFF \
    -DBUILD_QCH=ON
  make
}

package() {
  cd build
  make DESTDIR="$pkgdir" install
}
